﻿using System;
using System.Diagnostics;
using System.Reflection;
using System.Xaml;

namespace agree.schema.xaml
{
	public static class _a_extensions
	{
		static MethodInfo _mi_TryParseUri;

		static _a_extensions()
		{
			_mi_TryParseUri = typeof(XamlSchemaContext).Assembly
					.GetType("System.Xaml.Schema.ClrNamespaceUriParser")
					.GetMethod("TryParseUri", BindingFlags.Static | BindingFlags.Public);
		}

		public static bool TryParseUri(this String sUri, out String sClrNs, out String sAssemb)
		{
			var arr = new Object[3];
			arr[0] = sUri;
			bool f_ok = (bool)_mi_TryParseUri.Invoke(null, arr);
			sClrNs = (String)arr[1];
			sAssemb = (String)arr[2];
			return f_ok;
		}
	};
}
